﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Maticsoft.DBUtility;
using System.Data.SqlClient;

namespace ElingOA6_Admin_DSJCJ.DAL
{
    public partial class PeerReviewRuleScore
    {
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select FPeerReviewRuleCd,FPeerReviewID,a.FPeerReviewRuleScoreCd,FScore ");
            strSql.Append(" FROM dbo.t_PeerReviewRuleScore a ,dbo.[t_PeerReviewRuleOption] b ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by FDispSeq ");
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ElingOA6_Admin_DSJCJ.Model.PeerReviewRuleScore DataRowToModel(DataRow row)
        {
            ElingOA6_Admin_DSJCJ.Model.PeerReviewRuleScore model = new ElingOA6_Admin_DSJCJ.Model.PeerReviewRuleScore();
            if (row != null)
            {
                if (row["FPeerReviewRuleCd"] != null)
                {
                    model.FPeerReviewRuleCd = row["FPeerReviewRuleCd"].ToString();
                }
                if (row["FPeerReviewID"] != null && row["FPeerReviewID"].ToString() != "")
                {
                    model.FPeerReviewID = decimal.Parse(row["FPeerReviewID"].ToString());
                }
                if (row["FPeerReviewRuleScoreCd"] != null)
                {
                    model.FPeerReviewRuleScoreCd = row["FPeerReviewRuleScoreCd"].ToString();
                }
                if (row["FScore"] != null && row["FScore"].ToString() != "")
                {
                    model.FScore = int.Parse(row["FScore"].ToString());
                }
            }
            return model;
        }


    }
}
